package BehavioralPatterns.Interpreter;

public class Test {

  public static Expression getMaleExpression(){
    TerminalExpression will = new TerminalExpression("Will");
    TerminalExpression ospreay = new TerminalExpression("Ospreay");
    return new OrExpression(will,ospreay);
  }

  public static Expression getMarriedWomenExpression(){
    TerminalExpression sasha = new TerminalExpression("Sasha");
    TerminalExpression married = new TerminalExpression("married");
    return new AndExpression(sasha,married);
  }



  public static void main(String[] args) {
    Expression maleExpression = getMaleExpression();
    Expression marriedWomenExpression = getMarriedWomenExpression();

    System.out.println("Will is male ? " + maleExpression.interpret("Will"));
    System.out.println("Sasha is married ? " + marriedWomenExpression.interpret("Sasha married"));
  }
}
